﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>叩丁狼CRM(演示版)</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <#include "../common/head.ftl"/>
    <#include "../common/mycode.ftl"/>
    <link rel="stylesheet" href="/css/core.css"/>
</head>
<body>
<#assign menu="role"/>
<div class="container " style="margin-top: 20px">
    <#include "../common/welcome.ftl"/>
    <div class="row">

        <#include "../common/menu.ftl"/>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">角色编辑</h1>
                </div>
            </div>
            <div class="row col-sm-10">
                <form class="form-horizontal" action="/role/saveOrUpdate.do" method="post" id="editForm">
                    <input type="hidden" name="id" value="${(entity.id)!}">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">角色名称：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="name" value="${(entity.name)!}"
                                   placeholder="请输入角色名称">
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-2 control-label">角色编号：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="sn" value="${(entity.sn)!}"
                                   placeholder="请输入角色编码">
                        </div>
                    </div>

                    <div class="form-group" id="permission">
                        <div>
                            <label for="permission" class="control-label" style="margin-left: 60px">分配权限：</label>
                        </div>
                        <div class="row" style="margin-top: 10px">
                            <div class="col-sm-4 col-sm-offset-1">
                                <select multiple class="form-control allSelect" size="15">
                                    <#list permissions as p>
                                        <option value="${p.id}">${p.name}</option>
                                    </#list>
                                </select>
                            </div>
                            <div class="col-sm-2" style="margin-top: 60px;" align="center">
                                <div>
                                    <a type="button" class="btn btn-info  " style="margin-top: 10px"
                                       onclick="moveSelected('allSelect', 'selfSelect')">&nbsp;&gt;&nbsp;</a>
                                    <br>
                                    <a type="button" class="btn btn-info " style="margin-top: 10px"
                                       onclick="moveSelected('selfSelect', 'allSelect')">&nbsp;&lt;&nbsp;</a>
                                    <br>
                                    <a type="button" class="btn btn-info " style="margin-top: 10px"
                                       onclick="moveAll('allSelect', 'selfSelect')">&gt;&gt;</a>
                                    <br>
                                    <a type="button" class="btn btn-info " style="margin-top: 10px"
                                       onclick="moveAll('selfSelect', 'allSelect')">&lt;&lt;</a>
                                </div>
                            </div>

                            <div class="col-sm-4">
                                <select multiple class="form-control selfSelect" size="15" name="ids">
                                    <#if entity??>
                                    <#list entity.permissions as p>
                                        <option value="${(p.id)!}">${(p.name)!}</option>
                                    </#list>
                                    </#if>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-6">
                            <button id="btn_submit" type="button" class="btn btn-default">保存</button>
                            <button type="reset" class="btn btn-default">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>